package com.zhao.mapper;

import com.zhao.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zhao
 * @description TODO
 * @date 2022-12-05 16:12
 */

@Mapper
public interface UserMapper {
    @Select("select * from sys_user")
    List<User> findAll();

    @Select("select * from sys_user where username like #{username} limit #{pageNum},#{pageSize}")
    List<User> selectPage(Integer pageNum, Integer pageSize, String username);

    @Select("Select count(*) from sys_user where username like concat('%',#{username},'%')")
    Integer selectTotal(String username);
}
